﻿<UserControl x:Class="UnityEditor.Controls.MenuControl.MenuControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:msb="clr-namespace:UnityEditor.Controls.MenuSearchControl"
             mc:Ignorable="d" 
             d:DesignHeight="300" 
             d:DesignWidth="300" xmlns:my="clr-namespace:UnityEditor.Layout">
    <Grid Height="100">
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>
        
        <Menu Grid.Row="0" Height="Auto" VerticalAlignment="Top" x:Name ="Menu">
            <MenuItem Header="Project">
                <MenuItem Header="Play" Command="{Binding Path=PlayCommand, RelativeSource={RelativeSource FindAncestor, AncestorType=my:XEditorWindow, AncestorLevel=1}}"/>
                <MenuItem Header="Play(Window)" Command="{Binding Path=PlayInWindowCommand, RelativeSource={RelativeSource FindAncestor, AncestorType=my:XEditorWindow, AncestorLevel=1}}"/>
                <MenuItem Header="Pause" Command="{Binding Path=PauseCommand, RelativeSource={RelativeSource FindAncestor, AncestorType=my:XEditorWindow, AncestorLevel=1}}"/>
                <MenuItem Header="Stop" Command="{Binding Path=StopCommand, RelativeSource={RelativeSource FindAncestor, AncestorType=my:XEditorWindow, AncestorLevel=1}}"/>
            </MenuItem>
            <MenuItem Header="Hierarchy">
                <MenuItem Header="Load" Command="{Binding Path=LoadSceneCommand, RelativeSource={RelativeSource FindAncestor, AncestorType=my:XEditorWindow, AncestorLevel=1}}"/>
                <MenuItem Header="Save" Command="{Binding Path=SaveSceneCommand, RelativeSource={RelativeSource FindAncestor, AncestorType=my:XEditorWindow, AncestorLevel=1}}"/>
                <MenuItem Header="SaveAs" Command="{Binding Path=SaveAsSceneCommand, RelativeSource={RelativeSource FindAncestor, AncestorType=my:XEditorWindow, AncestorLevel=1}}"/>
            </MenuItem>
            <MenuItem Header="Layout">
                <MenuItem Header="Load" Command="{Binding Path=LoadLayoutCommand, RelativeSource={RelativeSource FindAncestor, AncestorType=my:XEditorWindow, AncestorLevel=1}}"/>
                <MenuItem Header="Save" Command="{Binding Path=SaveLayoutCommand, RelativeSource={RelativeSource FindAncestor, AncestorType=my:XEditorWindow, AncestorLevel=1}}"/>
            </MenuItem>
            <MenuItem Header="Help">
                <msb:MenuSearchBox />
            </MenuItem>
        </Menu>
        <DockPanel LastChildFill="False" Margin="0,0,0,-26" Height="26" Grid.Row="1" VerticalAlignment="Bottom">
        	<ToolBarTray Height="28" VerticalAlignment="Top" Width="auto">
        		<ToolBar Margin="0,0,0,7.96" d:LayoutOverrides="Width, Height" IsOverflowOpen="False">
        			<Button x:Name="playButton"  Width="auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" d:LayoutOverrides="Height"
        				Command="{Binding PlayCommand, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type my:XEditorWindow}}}">
        				<Image Height="16" Source="/UnityEditor;component/Images/Play.png" Stretch="Fill" Width="16"/>
        			</Button>
        			<Button x:Name="pauseButton" Width="auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" d:LayoutOverrides="Height"
        				Command="{Binding PauseCommand, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type my:XEditorWindow}}}">
        				<Image Height="16" Source="/UnityEditor;component/Images/Pause.png" Stretch="Fill" Width="16"/>
        			</Button>
        			<Button x:Name="stopButton" Width="auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" d:LayoutOverrides="Height"
        				Command="{Binding StopCommand, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type my:XEditorWindow}}}">
        				<Image Height="16" Source="/UnityEditor;component/Images/Stop.png" Stretch="Fill" Width="16"/>
        			</Button>
        		</ToolBar>
        	</ToolBarTray>
        </DockPanel>
    </Grid>
</UserControl>
